/*  This file is part of the Vc library.

    Copyright (C) 2009 Matthias Kretz <kretz@kde.org>

    Vc is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation, either version 3 of
    the License, or (at your option) any later version.

    Vc is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Vc.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef VC_FTR_RECURS
// main include
#define CAT_HELPER(a, b) a##b
#define CAT(a, b) CAT_HELPER(a, b)

# define VC_FTR_RECURS 15
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 14
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 13
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 12
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 11
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 10
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 9
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 8
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 7
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 6
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 5
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 4
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 3
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 2
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 1
# include "forceToRegisters2.def"
# define VC_FTR_RECURS 0
# include "forceToRegisters2.def"

#undef CAT_HELPER
#undef CAT

#else
// sub-includes

#ifndef VC_FTR_PART
template<typename T16
# define VC_FTR_PART 2
# include "forceToRegisters2.def"
> static inline void forceToRegisters(const Vector<T16> &
#ifndef VC_FTR_EMPTY
        x16
#endif
# undef VC_FTR_PART
# define VC_FTR_PART 3
# include "forceToRegisters2.def"
        ) {
#ifndef VC_FTR_EMPTY
    __asm__ __volatile__(""::"x"(x16.data())
#endif
# undef VC_FTR_PART
# define VC_FTR_PART 4
# include "forceToRegisters2.def"
#ifndef VC_FTR_EMPTY
            );
#endif
}
template<typename T16
# undef VC_FTR_PART
# define VC_FTR_PART 2
# include "forceToRegisters2.def"
> static inline void forceToRegistersDirty(Vector<T16> &
#ifndef VC_FTR_EMPTY
        x16
#endif
# undef VC_FTR_PART
# define VC_FTR_PART 5
# include "forceToRegisters2.def"
        ) {
#ifndef VC_FTR_EMPTY
    __asm__ __volatile__("":"+x"(x16.data())
#endif
# undef VC_FTR_PART
# define VC_FTR_PART 6
# include "forceToRegisters2.def"
#ifndef VC_FTR_EMPTY
            );
#endif
}
# undef VC_FTR_PART
# undef VC_FTR_RECURS

#elif VC_FTR_PART > 1 && VC_FTR_RECURS > 0
#  if VC_FTR_PART == 2
, typename CAT(T, VC_FTR_RECURS)
#  elif VC_FTR_PART == 3
, const Vector<CAT(T, VC_FTR_RECURS)> &
#ifndef VC_FTR_EMPTY
CAT(x, VC_FTR_RECURS)
#endif
#  elif VC_FTR_PART == 4
#ifndef VC_FTR_EMPTY
, "x"(CAT(x, VC_FTR_RECURS).data())
#endif
#  elif VC_FTR_PART == 5
, Vector<CAT(T, VC_FTR_RECURS)> &
#ifndef VC_FTR_EMPTY
CAT(x, VC_FTR_RECURS)
#endif
#  elif VC_FTR_PART == 6
#ifndef VC_FTR_EMPTY
, "+x"(CAT(x, VC_FTR_RECURS).data())
#endif
#  endif

# if VC_FTR_RECURS == 15
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 14
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 15
# elif VC_FTR_RECURS == 14
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 13
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 14
# elif VC_FTR_RECURS == 13
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 12
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 13
# elif VC_FTR_RECURS == 12
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 11
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 12
# elif VC_FTR_RECURS == 11
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 10
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 11
# elif VC_FTR_RECURS == 10
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 9
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 10
# elif VC_FTR_RECURS == 9
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 8
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 9
# elif VC_FTR_RECURS == 8
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 7
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 8
# elif VC_FTR_RECURS == 7
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 6
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 7
# elif VC_FTR_RECURS == 6
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 5
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 6
# elif VC_FTR_RECURS == 5
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 4
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 5
# elif VC_FTR_RECURS == 4
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 3
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 4
# elif VC_FTR_RECURS == 3
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 2
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 3
# elif VC_FTR_RECURS == 2
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 1
#  include "forceToRegisters2.def"
#  undef VC_FTR_RECURS
#  define VC_FTR_RECURS 2
# endif

#endif
#endif

// vim: ft=cpp
